﻿using Microsoft.EntityFrameworkCore;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using CRM.Enums;

namespace CRM.Models
{
    [Table("user_group")]
    [Comment("用户管理_用户组")]
    [Index(nameof(Name), Name = "Name")]
    [Index(nameof(CompanyId), Name = "CompanyId")]
    [Index(nameof(OemId), Name = "OemId")]
    [Index(nameof(State), Name = "State")]
    public class UserGroup: BaseModel
    {
        [Column("id"), Key, Required]
        public int Id { get; set; }

        [Column("name", TypeName = "varchar(255)"), Comment("用户组名称"), Required]
        public string Name { get; set; }

        [Column("state", TypeName = "tinyint"), Comment("状态1启用2禁用"), Required]
        public States State { get; set; } = States.ENABLE;

        [Column("sort", TypeName = "int(11)"), Comment("排序字段"), Required]
        public long Sort { get; set; }

        [Column("company_id", TypeName = "int(11)"), Comment("公司ID"), Required]
        public int CompanyId { get; set; }

        [Column("oem_id"), Comment( "贴牌OEM ID(分区id)"), Required]
        public int OemId { get; set; }

    }
}
